home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CMIDI 2.2 / CMIDIPort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.7 KB  |  52 lines  |  [TEXT/KAHL]

  1. /*
  2.  *——— CMIDIPort.h ———————————————————————————————————————————————————————————
  3.  * Copyright © Paul Ferguson, 1990-94.  All rights reserved.
  4.  *
  5.  *    For use with Symantec C++ 6.0 and the THINK Class Library.
  6.  *
  7.  * Description:
  8.  *    An abstract class for all MIDI Manager port classes.
  9.  *
  10.  *    Refer to the CMIDI Programmer's Manual for a complete desciption of
  11.  *    this class.
  12.  *————————————————————————————————————————————————————————————————————————————
  13.  */
  14.  
  15. #pragma once
  16. #include "CMIDIClient.h"
  17.  
  18. class CMIDIPort : public CObject        // An abstract port, with methods and instance
  19. {                                        // variables common to all port objects.
  20. protected:                                // only called by subclass initializers
  21.  
  22.     OSErr            IMIDIPort(MIDIPortParams * portParams, short bufSize);
  23.  
  24. public:
  25.  
  26.     virtual    void    Dispose(void);
  27.     MIDIPortInfoHdl    GetPortInfo(void);
  28. #ifdef __cplusplus
  29.     short            GetRefNum(void) { return itsRefNum; };
  30.     long            GetRefCon(void) { return (itsVersion ? MIDIGetRefCon(itsRefNum) : 0); };
  31.     void            SetRefCon(long theRefCon) { if (itsVersion) MIDISetRefCon(itsRefNum, theRefCon); };
  32. #else
  33.     short            GetRefNum(void);
  34.     long            GetRefCon(void);
  35.     void            SetRefCon(long theRefCon);
  36. #endif
  37.     void            GetPortName(StringPtr theName);
  38.     void            SetPortName(StringPtr theName);
  39.     virtual    OSErr    LoadPatches(ResType theResType, short theResID);
  40.     virtual    OSErr    SavePatches(ResType theResType, short theResID);
  41.     void            SetConnectionProc(ProcPtr theConnectProc, long theRefCon);
  42.     void            GetConnectionProc(ProcPtr *    theConnectProc, long * theRefCon);
  43.  
  44. protected:
  45.  
  46.     short            itsRefNum;            // From AddPort()
  47.     OSType            itsPortID;            // Identifier in MIDI Manager
  48.     OSErr            itsResult;            // Used by SavePatches()
  49.     unsigned short    itsVersion;            // Save upper word of client version
  50. };
  51.  
  52. // end of CMIDIPort.h